package com.share.order.api.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@TableName("order_info")
@Schema(defaultValue = "订单信息实体")
public class OrderInfo {

    @TableId(type = IdType.AUTO)
    @Schema(defaultValue = "主键ID")
    private Long id;

    @Schema(defaultValue = "用户ID")
    private Long userId;

    @Schema(defaultValue = "用户昵称")
    @TableField(value = "nickname")
    private String nickname;

    @Schema(description = "订单号")
    private String orderNo;

    @Schema(description = "充电宝编号")
    private String powerBankNo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "借用开始时间")
    private Date startTime;

    @Schema(description = "借用站点ID")
    private Long startStationId;

    @Schema(description = "借用地点名称")
    private String startStationName;

    @Schema(description = "借用柜机编号")
    private String startCabinetNo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "归还时间")
    private Date endTime;

    @Schema(description = "归还站点ID")
    private Long endStationId;

    @Schema(description = "归还地点名称")
    private String endStationName;

    @Schema(description = "归还柜机编号")
    private String endCabinetNo;

    @Schema(description = "借用时长（分钟）")
    private Integer duration;

    @Schema(description = "费用规则描述")
    private String feeRule;

    @Schema(description = "费用规则ID")
    private Long feeRuleId;

    @Schema(description = "总金额")
    private BigDecimal totalAmount;

    @Schema(description = "抵扣金额")
    private BigDecimal deductAmount;

    @Schema(description = "实际支付金额")
    private BigDecimal realAmount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "支付时间")
    private LocalDateTime payTime;

    @Schema(description = "微信支付交易号")
    private String transactionId;

    @Schema(description =  "订单状态：0-充电中 1-未支付 2-已支付")
    private String status;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "更新人")
    private String updateBy;

    @Schema(description =  "删除标志：0-存在 2-删除")
    private String delFlag;

    @Schema(description = "备注")
    private String remark;
}
